/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package ec.edu.espe.ccsoft.mantenimiento.servicios;

import ec.edu.espe.ccsoft.mantenimiento.dao.MecanicoFacade;
import ec.edu.espe.ccsoft.mantenimiento.modelos.Mecanico;
import ec.edu.espe.ccsoft.mantenimiento.modelos.Pais;
import java.util.List;
import javax.ejb.EJB;
import javax.ejb.LocalBean;
import javax.ejb.Stateless;

/**
 *
 * @author Carlos
 */
@Stateless
@LocalBean
public class MecanicoServicio {
    
    @EJB
    MecanicoFacade mecanicoFacade;
    
    public List<Mecanico> findByMecanico(){
        return mecanicoFacade.findAllByEstate(Boolean.TRUE);        
    }
    
    public void createMecanico(Mecanico mecanico){
        mecanicoFacade.create(mecanico);
    }
    
    public void updateMecanico(Mecanico mecanico){
        mecanicoFacade.edit(mecanico);
    }
    
    public Mecanico findByCedula(String cedula){
        return mecanicoFacade.findByCedula(cedula);
    }

    public List<Mecanico> FindAllMecanico() {
        return mecanicoFacade.findByEstado(Boolean.TRUE);
    }
    
    
    
}
